<template>
  <div>
    <!-- 面包屑导航条 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>申购管理</el-breadcrumb-item>
      <el-breadcrumb-item>申购列表</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- 搜索区域 -->
    <div style="display:flex;align-items:center;">
      <el-row :gutter="20">
        <el-col :span="20">
          <el-input
            clearable
            placeholder="请输入电话号码"
            class="input-with-select"
            maxlength="11"
            v-model="telephone"
          >
            <!-- <el-button slot="append" icon="el-icon-search" @click="getGoodsList"></el-button> -->
          </el-input>
        </el-col>

        <!-- <el-col :span="4">
        <el-button type="primary" @click="goAdd">添加商品</el-button>
        </el-col>-->
      </el-row>
      <div style="margin-right:1rem;">
        <el-date-picker v-model="dateValue" type="date" placeholder="选择日期"></el-date-picker>
      </div>
      <el-dropdown @command="handleCommand">
        <el-button type="primary">
          {{shaixuanContent}}
          <i class="el-icon-arrow-down el-icon--right"></i>
        </el-button>
        
          <el-dropdown-menu slot="dropdown">
                <el-dropdown-item
                  :command="i"
                  v-for="(item,i) in statusList"
                  :key="i"
                >{{item.name}}</el-dropdown-item>
                <!-- <el-dropdown-item command="b">狮子头</el-dropdown-item>
                <el-dropdown-item command="c">螺蛳粉</el-dropdown-item>
                <el-dropdown-item command="d">双皮奶</el-dropdown-item>
                <el-dropdown-item command="e">蚵仔煎</el-dropdown-item>-->
              </el-dropdown-menu>
          <!-- <el-dropdown-item>待支付</el-dropdown-item>
          <el-dropdown-item>进行中</el-dropdown-item>
          <el-dropdown-item>已完成</el-dropdown-item>
          <el-dropdown-item>审核失败</el-dropdown-item>
          <el-dropdown-item>已失效</el-dropdown-item> -->
      

      </el-dropdown>
      <el-button type="primary" @click="shaixuan" style="margin-left:1rem;">查询</el-button>
      <el-button type="primary" @click="qingkong" style="margin-left:1rem;">清空</el-button>
    </div>

    <!-- table 表格区域 -->
    <el-table :data="shenGouList" border stripe>
      <!--:data="goodslist"-->
      <el-table-column type="index"></el-table-column>
      <!-- <el-table-column label="申购名称" prop="name" width="200"></el-table-column> -->
      <!-- <el-table-column label="申购" prop="money" width="95"></el-table-column> -->
      <el-table-column label="姓名" prop="nickName" width="160"></el-table-column>
      <el-table-column label="电话" prop="mobile" width="160"></el-table-column>
      <el-table-column label="申购数量(CY)" prop="numbers" width="160"></el-table-column>
      <!-- <el-table-column label="商品重量" prop="goods_weight" width="70"></el-table-column> -->
      <el-table-column label="申购时间" width="160" prop="createTime"></el-table-column>
      <el-table-column label="订单状态" width="160">
        <template slot-scope="scope">
          <div
            style="width:100%;text-align:center;"
          >{{scope.row.status==0?"待支付":scope.row.status==1?"进行中":scope.row.status==2?"已完成":scope.row.status==3?"审核失败":scope.row.status==4?"已失效":""}}</div>
        </template>
      </el-table-column>
      <el-table-column label="申购图片" width="160">
        <!--  prop="image"-->
        <template slot-scope="scope">
          <el-popover placement="right" width="400" trigger="click">
            <!-- <div>{{scope.row.certificate}}</div> -->
            <div
              v-for="(item,i) in scope.row.certificate"
              :key="i"
              style="display:flex;align-items:center;flex-direction:column;margin-bottom:2rem;"
            >
              <!-- <div>{{item}}</div> -->
              <img :src="item" alt style="width:10rem;height:auto;" />
              <!-- <img src="item" alt="" style="width:5rem;height:3rem;"> -->
            </div>
            <el-button type="primary" size="mini" slot="reference">点击查看</el-button>
          </el-popover>

          <!-- <el-button type="danger" size="mini" @click="jujue(scope)">拒绝</el-button> -->
        </template>
        <!-- <div @click="showImageMask(scope)" prop="image"></div> -->
      </el-table-column>
      <!-- <template slot-scope="scope">
          {{scope.row.beginTime | dateFormat}}
      </template>-->

      <el-table-column label="操作" width="200">
        <template slot-scope="scope">
          <el-button type="primary" size="mini" @click="tongyi(scope)">同意</el-button>
          <el-button type="danger" size="mini" @click="jujue(scope)">拒绝</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页区域 -->
    <el-pagination
      background
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="queryinfo.pagenum"
      :page-sizes="[10, 15, 20, 30]"
      :page-size="queryinfo.pagesize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total"
    ></el-pagination>

    <!--图片查看弹窗框-->
    <!-- <div class="mask-proup" v-if="isShowImage">
      <div @click="cancelMask">取消</div>
      <div>这是一个图片弹窗</div>
    </div>-->
  </div>
</template>

<script>
import mix from "./shengou-mixins.js";
export default {
  mixins: [mix]
};
</script>

<style lang="less" scoped>
.mask-proup {
  background: rgba(0, 0, 0, 0.6);
  width: 20rem;
  height: 10rem;
  color: #ffffff;
  position: fixed;
  left: 50%;
  top: 20%;
}
</style>
